package com.tyfspring.beans.factory;

import com.tyfspring.beans.config.BeanDefinition;
import com.tyfspring.beans.config.BeanPostProcessor;
import com.tyfspring.beans.exception.BeansException;

/**
 * @Description 通常被用于编写高级的Bean操作逻辑，例如自定义BeanPostProcessor、自定义Bean Scope等。
 * 同时，它也是Spring框架中其他一些高级组件的基础
 * @Author shallow
 * @Date 2023/3/26 14:03
 */
public interface ConfigurableListableBeanFactory extends ListableBeanFactory,AutowireCapableBeanFactory,ConfigurableBeanFactory{
    /**
     * 根据名称查找BeanDefinition
     *
     * @param beanName
     * @return
     * @throws BeansException 如果找不到BeanDefintion
     */
    BeanDefinition getBeanDefinition(String beanName) throws BeansException;

    /**
     * 提前实例化所有单例实例
     *
     * @throws BeansException
     */
    void preInstantiateSingletons() throws BeansException;

    /**
     * 添加bean后处理器
     * @param beanPostProcessor
     */
    void addBeanPostProcessor(BeanPostProcessor beanPostProcessor);
}
